package com.seray.zebraprintlib.content;

import com.seray.zebraprintlib.config.PrintConfig;

/**
 * Author：李程
 * CreateTime：2018/8/8 15:43
 * E-mail：licheng@kedacom.com
 * Describe：
 */
public abstract class AZebraContent {

    /**
     * 回车
     */
    static final String BREAK = "\r\n";

    /**
     * 逗号
     */
    static final String COMMA = ",";

    /**
     * 属性内容起始符
     */
    static final String FILED_START = "^FD";

    /**
     * 属性内容结束符
     */
    static final String FILED_END = "^FS";

    /**
     * 行开头 **行位置信息**
     */
    static final String LINE_START = "^FO";
    /**
     * 大小
     */
    public int size;
    /**
     * 属性 KEY
     */
    protected String key;
    /**
     * 属性 VALUE
     */
    protected String content;
    /**
     * 行类型  **字体或条码或二维码**
     */
    String LINE_TYPE;
    /**
     * 打印方向
     */
    String direction;
    /**
     * 行起始位 X坐标
     */
    int x;

    /**
     * 行起始位 Y坐标
     */
    int y;

    AZebraContent(int x, int y, int size, PrintConfig.Direction direction, String key, String content) {
        this.x = x;
        this.y = y;
        this.size = size;
        this.direction = (direction == PrintConfig.Direction.N ? "N" : "R");
        this.key = key;
        this.content = content;
    }

    public String getKey() {
        return key;
    }

    public String getContent() {
        return content;
    }

    public abstract String install();

}
